package com.bilibili.liveremind.module;

import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpRequest;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class test {
    public static void main(String[] args) {


       String cookie = "buvid3=3E8DC1D8-D75E-7470-2779-1FC4702DF90E45478infoc; b_nut=1685868945; i-wanna-go-back=-1; _uuid=D7D68622-5358-B95E-955C-2610AC6B724E145033infoc; FEED_LIVE_VERSION=V8; buvid4=3639C4E5-0D58-3F10-826A-585F6C3CA7B346529-023060416-aCc7jQNzzY1k7W3FMFXZYg%3D%3D; rpdid=|(J~R~u|lYJ~0J'uY)l)Ym|JJ; nostalgia_conf=-1; b_ut=5; buvid_fp_plain=undefined; hit-new-style-dyn=1; hit-dyn-v2=1; LIVE_BUVID=AUTO8716877591792462; CURRENT_BLACKGAP=0; is-2022-channel=1; CURRENT_QUALITY=120; enable_web_push=DISABLE; header_theme_version=CLOSE; DedeUserID=102076113; DedeUserID__ckMd5=b76e7ce580a79133; CURRENT_FNVAL=4048; bp_article_offset_102076113=905686161809211401; bili_ticket=eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTAyMTk0NTQsImlhdCI6MTcwOTk2MDE5NCwicGx0IjotMX0.9o0eUc4Y5400k7FRSJbU_B9LyYy-oBGEwIyIN4J4wF8; bili_ticket_expires=1710219394; fingerprint=4ddc579bd9addc4c19b80839ad87968a; buvid_fp=4ddc579bd9addc4c19b80839ad87968a; home_feed_column=5; browser_resolution=1707-898; SESSDATA=4ea155cc%2C1725603876%2C2a45b%2A31CjBH6ZP_gEOmyS75yiYGsuAgIcXJn8YOAWvWd7DVWHG2SY8EprPcgp4oOyRlQB_1mg0SVmFYRmdzc2t0RHZCX2dRQUpPbERiTEFQZFg0TVk0VHJ1eTRXWmpxRlZBOWQ4UmFScVRsMlpDOE9vdGZTVFVvSGE4RnlWTzlrSkxBaDNhRDNxQjJoRlh3IIEC; bili_jct=dc746756de2cc475df51dd21b1d0ad43; b_lsid=A793382F_18E274517AC; Hm_lvt_8a6e55dbd2870f0f5bc9194cddf32a02=1709812128,1709822798,1709983732,1710056241; Hm_lpvt_8a6e55dbd2870f0f5bc9194cddf32a02=1710056252; PVID=1; bp_video_offset_102076113=907182541312622601";
       //获取用户直播弹幕信息getInfoByUser https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByUser?room_id=6326729&from=0&not_mock_enter_effect=1&web_location=444.8&w_rid=a78b82b244c1c0f78ff9387ad84925a7&wts=1710061727
        String getInfoUserUrl = " https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByUser";
        //room_id=6326729
        Map<String,Object> map = new HashMap<>();
        map.put("room_id",6326729);
        String body1 = HttpRequest
                .get(getInfoUserUrl)
                .form(map)
                .header("Cookie",cookie)
                .execute().body();
        System.out.println(body1);
        //发送弹幕
       /*String sendUrl = "https://api.live.bilibili.com/msg/send";
         *//**
         * bubble: 5
         * msg: 是的吧
         * color: 14893055
         * mode: 4
         * room_type: 0
         * jumpfrom: 82001
         * reply_mid: 0
         * reply_attr: 0
         * replay_dmid:
         * statistics: {"appId":100,"platform":5}
         * fontsize: 25
         * rnd: 1710056248
         * roomid: 6326729
         * csrf: dc746756de2cc475df51dd21b1d0ad43
         * csrf_token: dc746756de2cc475df51dd21b1d0ad43
         *//*
        Map<String,Object> paramMap = new HashMap<>();
        //paramMap.put("bubble",5);
        paramMap.put("msg","这jett太坑了阿");
        paramMap.put("color",14893055);
        //paramMap.put("mode",4);
        //paramMap.put("room_type",0);
        //paramMap.put("jumpfrom",82001);
        //paramMap.put("reply_mid",0);
        //paramMap.put("reply_attr",0);
        //paramMap.put("replay_dmid","");
        //Map<String,Object> replayDmidMap = new HashMap<>();
        //replayDmidMap.put("appId",100);
        //replayDmidMap.put("platform",5);
        //paramMap.put("statistics",replayDmidMap);
        paramMap.put("fontsize", 25);
        paramMap.put("rnd", DateUtil.currentSeconds());
        paramMap.put("roomid",6326729);
        paramMap.put("csrf","dc746756de2cc475df51dd21b1d0ad43");
        paramMap.put("csrf_token","dc746756de2cc475df51dd21b1d0ad43");
        System.out.println(DateUtil.currentSeconds());
        String body = HttpRequest
                .post(sendUrl)
                .form(paramMap)
                .header("Cookie",cookie)
                .execute().body();
        System.out.println(body);*/

    }
}
